<?php

namespace App\Models\Purchase;

use App\Enum;
use App\Models\BaseModel;

class PurchaseOrder extends BaseModel
{
    //
    protected $fillable=[
        'order_no',
        'supplier_id',
        'storage_id',
        'total_cost_price',
        'status',
        'remarks',
        'user_id',
        'finished_at',
        'review_at'
    ];

    protected $hidden = [
    ];


    public function purchaseItems()
    {
        return $this->hasMany(PurchaseItem::class,'order_id','id')->where('is_enable',Enum::IS_ENABLE_TRUE);
    }
}
